package com.bst.bsj.bops.web.biz.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bst.bsj.bops.web.biz.RoleResourceService;
import com.bst.bsj.common.dal.daointerface.RoleResourceDAO;
import com.bst.bsj.common.dal.dataobject.RoleResource;


@Service("roleResourceService")
public class RoleResourceServiceImpl implements RoleResourceService {
  @Autowired
  private RoleResourceDAO roleResourceDao;

  private static final Log logger = LogFactory.getLog(RoleResourceServiceImpl.class);

  @Override
  public int delete(Long roleId) {
    int lid = 0;
    try {
      lid = roleResourceDao.delete(roleId);

    } catch (Exception e) {
      logger.error("RoleResourceServiceImpl.delete(id) error!", e);
    }
    return lid;
  }

  @Override
  public Long save(RoleResource roleResource) {
    Long lid = 0l;
    try {
      lid = roleResourceDao.save(roleResource);
    } catch (Exception e) {
      logger.error("RoleResourceServiceImpl.save(banner) error!", e);
    }
    return lid;
  }

  @Override
  public List<RoleResource> getResourceByRoleId(Long roleId) {
    return roleResourceDao.getResourceByRoleId(roleId);
  }

  
}
